﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _13
{

    //雇员系统，定义雇员基类，共同的属性，姓名、地址和出生日期(可有可无)，
    //子类：程序员，秘书，高层管理，清洁工，
    //他们有不同的工资算法，其中高级主管和程序员采用底薪加提成(6000)的方式，
    //高级主管和程序员的底薪分别是5000元和2000元?，秘书和清洁工采用工资的方式，
    //工资分别是3000和1000，（以多态的方式处理程序。）
    class employee
    {
        protected string Name;
        protected string site;
        protected double salary;

        public employee(string name ,string site,double salary)
        {
            this.Name = name;
            this.site = site;
            this.salary = salary;
        }
        public virtual void salary1()
        { 
        }
    }
    class programmer : employee //程序员
    {
        protected double basic;

        
        public programmer(string name, string site,double basic,double salary) : base(name,site,salary)
        {
            this.basic = basic;
        }
        public override void salary1()
        {
            double money = salary + basic;
            Console.WriteLine("程序员,姓名{0},住址{1},工资为{2}",Name,site,money);
        
        }

    }
    class secretary : employee //秘书
    {
       
        public secretary(string name, string site,double salary) : base(name, site,salary)
        { 
        }

        public override void salary1()
        {
     
            Console.WriteLine("秘书,姓名{0},住址{1},工资为{2}", Name, site, salary);

        }

    }
    class ICU : employee //高层管理
    {
        protected double basic;
       

        public ICU(string name, string site, double basic, double salary) : base(name, site, salary)
        {
            this.basic = basic;
        }
        public override void salary1()
        {
            double money = salary + basic;
            Console.WriteLine("高管,姓名{0},住址{1},工资为{2}", Name, site, money);

        }

    }
    class dustman : employee //清洁工 
    {
        public dustman(string name, string site, double salary) : base(name, site, salary)
        {
        }
        public override void salary1()
        {

            Console.WriteLine("清洁工,姓名{0},住址{1},工资为{2}", Name, site, salary);

        }



    }



}
